﻿using System.Web;
using System.Web.Mvc;
using Calendar.Logic.Core;

namespace Calendar.Web.Core
{
    public class CalendarControllerFactory : DefaultControllerFactory
    {
        public override void ReleaseController(IController controller)
        {
            if (HttpContext.Current.PreviousHandler == null)
            {
                GlobalContext.Instance.DelDataContext();
            }
            base.ReleaseController(controller);
        }
    }
}